var wordCloudOption=function(data,head){
	
	var name = data.name;
	var aggType = data.aggType;
	var dimensionData = data.data;
	var cdId = data.cdId;
	var wordCloudData=[];
	if (dimensionData) {
		for(var i=0;i<dimensionData.length;i++){
			var obj = new Object();
			obj.name = dimensionData[i].Name;
			obj.value = dimensionData[i][cdId];
			obj.itemStyle = createRandomItemStyle();
			wordCloudData.push(obj);
		}
		
	}else{
		
	}
	wordCloudData.sort(compare_desc("value"));
//	console.log(JSON.stringify(wordCloudData))
	return {
	    title: {
//	        text: head,
//	        subtext: subhead
	    },
	    tooltip: {
	        show: false
	    },
	    series: [{
	        //name: 'Google Trends',
	        type: 'wordCloud',
	        size: ['80%', '80%'],
	        textRotation : [0, 45, 90, -45],
	        textPadding: 0,
	        autoSize: {
	            enable: true,
	            minSize: 14
	        },
	        data: wordCloudData
	    }],
	      noDataLoadingOption:{
          	text :"暂无数据",
          	    effect : 'bubble',
          	    effectOption:{
          	    	backgroundColor:"#fff",
          	    	effect:{
          	    		n:0
          	    	}
          	    },
          	    textStyle : {
          	        fontSize : 20
          	    }
          } 
	};

}
function createRandomItemStyle() {
    return {
        normal: {
            color: 'rgb(' + [
                Math.round(Math.random() * 160),
                Math.round(Math.random() * 160),
                Math.round(Math.random() * 160)
            ].join(',') + ')'
        }
    };
}

